// Kony


#include "AbilitySystem/Data/LevelUpInfo.h"
//通过修为值判断是否升级了
int32 ULevelUpInfo::FindLevelForXP(int32 XP) const
{
	int32 Level = 1;
	bool bSearching = true;
	while (bSearching)
	{
		// LevelUpInformation[1] = Level 1 
		if (LevelUpInformation.Num() - 1 <= Level) return Level;
		//判断经验值是否大于当前需求等级
		if (XP >= LevelUpInformation[Level].LevelUpRequirement)
		{
			//如果升级了就加1级
			Level++;
		}
		else
		{
			//如果没升级则返回当前等级
			bSearching = false;
		}
	}
	return Level;
}
